# Copyright 2008 Markus Dittrich <markusle@gentoo.org>
# Distributed under the terms of the GNU General Public License v3
#

PARSER_SOURCES := Parsers/CommandLine.hs \
		Parsers/Chost.hs \
		Parsers/Content.hs \
		Parsers/Depend.hs \
		Parsers/Keywords.hs \
		Parsers/Use.hs \
		Parsers/Slot.hs \
		Parsers/Version.hs


DRIVER_SOURCES := Drivers/Check.hs \
		Drivers/Content.hs \
		Drivers/Depend.hs \
		Drivers/Owner.hs \
		Drivers/SearchPackage.hs \
		Drivers/Use.hs \
		Drivers/Version.hs


HELPER_SOURCES := Helpers/ByteString.hs \
		Helpers/Common.hs \
		Helpers/FileIO.hs \
		Helpers/PrettyPrint.hs 


DEPEND_SOURCES := $(PARSER_SOURCES) $(DRIVER_SOURCES) \
		$(HELPER_SOURCES)
export DEPEND_SOURCES


all: release


release: hark.hs $(DEPEND_SOURCES)
	ghc $(GHC_FLAGS_RELEASE) --make hark.hs



devel: hark.hs $(DEPEND_SOURCES)
	ghc $(GHC_FLAGS_DEVEL) --make hark.hs



doc:
	@haddock -h -o ../html $(DEPEND_SOURCES)


.PHONY: clean

clean:
	rm -f *.o *.hi hark
	rm -f Drivers/*.o Drivers/*.hi
	rm -f Parsers/*.o Parsers/*.hi
	rm -f Helpers/*.o Helpers/*.hi
